<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
<!--#include virtual="users.inc.asp"-->
<!--#include virtual="search.inc.asp"-->
</head>

<body>
<%
if not chkadmin() then
	response.Write("你没有权限上传资料！</body></html>")
	response.End()
end if
'binary=num2binary(Split(request.Form("material"),", "))
'response.Write(ismatch(CInt(request.Form("leaf")),binary))
set conn=server.createobject("adodb.connection")
conn.open "provider=microsoft.jet.oledb.4.0;data source="&server.mappath("App_Data\MainDB.mdb")
set rs=server.createobject("adodb.recordset")
rs.open "SELECT * FROM [Species] WHERE ScientificName='" & request.Form("ScientificName") & "' or ChineseName='" & request.Form("ChineseName") & "'",conn,3,3
if not rs.eof then
	response.Write("学名或中文名已存在，将进行覆盖。")
else
	rs.addnew
end if
rs("ScientificName")=request.Form("ScientificName")
rs("ChineseName")=request.Form("ChineseName")
rs("CommonName")=request.Form("CommonName")
rs("PopIntro")=request.Form("PopIntro")
rs("SciIntro")=request.Form("SciIntro")
rs("material")=num2binary(Split(request.Form("material"),", "))
rs("leaf")=num2binary(Split(request.Form("leaf"),", "))
rs("leafarrangement")=num2binary(Split(request.Form("leafarrangement"),", "))
rs("leafmaterial")=num2binary(Split(request.Form("leafmaterial"),", "))
rs("leafedge")=num2binary(Split(request.Form("leafedge"),", "))
rs("leafshape")=num2binary(Split(request.Form("leafshape"),", "))
rs("flowercolor")=num2binary(Split(request.Form("flowercolor"),", "))
rs("flowershape")=num2binary(Split(request.Form("flowershape"),", "))
rs("TaxonID")=CInt(request.Form("TaxonID"))
rs.update
myid=rs("SpeciesID")
%>
<form id="form1" name="form1" method="post" action="upload.asp?id=<%=myid %>" enctype="multipart/form-data">
	<label for="filepath">图片上传</label>
	<input type="file" name="filepath" id="filepath" />
	<input type="submit" name="submit" id="submit" value="提交" />
</form>
<%
rs.close
set rs=nothing
conn.close
set conn=nothing
%>
</body>
</html>
